Skip to content

Gradle build speed improvements#2701

Open
8Keep wants to merge 2 commits into
jMonkeyEngine:masterfrom
8Keep:gradle-9-build-speed
Open

Gradle build speed improvements#2701
8Keep wants to merge 2 commits into
jMonkeyEngine:masterfrom
8Keep:gradle-9-build-speed

Conversation

@8Keep
Copy link
Copy Markdown
Contributor

@8Keep 8Keep commented Apr 10, 2026

Enable Gradle performance defaults:

  • org.gradle.parallel=true
  • org.gradle.caching=true
  • org.gradle.configuration-cache=true

Make normal local builds faster by default:

  • Skip JavaDoc generation by default with buildJavaDoc=false
  • Remove source and JavaDoc archive generation from the default assemble/build lifecycle
  • Keep source jars and JavaDoc jars available for publishing/distribution tasks

Keep release and publishing workflows complete:

  • Add -PbuildJavaDoc=true to GitHub Actions release, distribution, snapshot, and Central publishing commands
  • Preserve upstream snapshot deploy version behavior while still generating JavaDoc artifacts where publishing/distribution needs them

Reduce eager project work and make configuration cache work for more build paths:

  • Apply Groovy only where Groovy sources are present
  • Convert selected task hooks to configureEach and lazy task registration
  • Make mergedJavadoc compatible with configuration cache
  • Make createZipDistribution compatible with configuration cache
  • Refactor libDist to avoid execution-time Gradle model access
  • Refactor jme3-examples:dist to avoid execution-time Project/Configuration access

Improve related task behavior:

  • Make jme3-examples:run depend on the runtime classpath instead of the full build lifecycle
  • Fix the screenshot test workflow task path to use the explicit project name
  • Make prebuilt native downloads write to a temporary .part file before replacing the final zip
  • Add explicit Android native header copy dependencies on :jme3-android:compileJava
  • Give iOS native xcodebuild tasks isolated derived-data directories

Build speed measurement:

Case Before After Change
Clean ./gradlew clean build 79.62s 17.86s 4.46x faster, 77.6% less wall time
Immediate incremental ./gradlew build 1.59s 1.28s 1.24x faster, 19.5% less wall time
Warm incremental ./gradlew build 1.08s 0.56s 1.93x faster, 48.1% less wall time

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request upgrades the project to Gradle 9.4.1 and introduces significant build performance optimizations, including enabling the configuration cache, parallel execution, and build caching. The build logic has been refactored to utilize lazy task registration and configuration, and the external 'grgit' dependency was replaced with direct Git command execution to streamline the build process. Additionally, JavaDoc and source JAR generation are now disabled by default for local builds. Feedback focuses on addressing brittle logic in conditional plugin application, ensuring lazy dependency resolution to maintain configuration speed, and fixing type inconsistencies in versioning properties.

Comment thread common.gradle Outdated
Comment thread build.gradle Outdated
Comment thread common.gradle Outdated
Comment thread version.gradle Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 10, 2026

🖼️ Screenshot tests have failed.

The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests.

📄 Where to find the report:

⚠️ If you didn't expect to change anything visual:
Fix your changes so the screenshot tests pass.

If you did mean to change things:
Review the replacement images in jme3-screenshot-tests/build/changed-images to make sure they really are improvements and then replace and commit the replacement images at jme3-screenshot-tests/src/test/resources.

If you are creating entirely new tests:
Find the new images in jme3-screenshot-tests/build/changed-images and commit the new images at jme3-screenshot-tests/src/test/resources.

Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar".

See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information

Contact @richardTingle (aka richtea) for guidance if required

@8Keep 8Keep force-pushed the gradle-9-build-speed branch 8 times, most recently from dfab9a7 to b86a577 Compare April 15, 2026 23:58
@8Keep 8Keep force-pushed the gradle-9-build-speed branch from b86a577 to 44390a2 Compare April 16, 2026 00:52
@8Keep 8Keep force-pushed the gradle-9-build-speed branch from 512d5e6 to 13b5bec Compare May 9, 2026 20:33
@8Keep 8Keep force-pushed the gradle-9-build-speed branch from 13b5bec to 486be3f Compare May 9, 2026 21:44
@8Keep 8Keep marked this pull request as ready for review May 9, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant